package com.nut.course.api.req;

import com.nut.course.util.JacksonUtils;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class CourseOrderReq implements Serializable {

    private static final long serialVersionUID = 1L;

    //订购的课程列表
    private List<CourseNum> courses;


    public static void main(String[] args) {


        CourseNum courseNum = new CourseNum();
        courseNum.setCourseId(1);
        courseNum.setNum(1);

        CourseNum courseNum2 = new CourseNum();
        courseNum2.setCourseId(2);
        courseNum2.setNum(3);

        ArrayList<CourseNum> list = new ArrayList<>();
        list.add(courseNum);
        list.add(courseNum2);

        CourseOrderReq courseOrderReq = new CourseOrderReq();
        courseOrderReq.setCourses(list);

        String s = JacksonUtils.toJson(courseOrderReq);
        System.out.println(s);

    }
}
